package com.huhu.service.impl;

import com.huhu.entity.ArticleInfo;
import com.huhu.entity.vo.ArticleInfoVO;
import com.huhu.mapper.ArticleMapper;
import com.huhu.service.ArticleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {
    @Resource
    private ArticleMapper articleMapper;

    @Override
    public List<ArticleInfo> getMyList(Long uid) {
        return articleMapper.getMyList(uid);
    }

    @Override
    public int myArtCount(Long uid) {
        return articleMapper.myArtCount(uid);
    }

    @Override
    public List<ArticleInfo> getList(Integer psize, Integer offset) {
        return articleMapper.getList(psize,offset);
    }

    @Override
    public int getTotalCount() {
        return articleMapper.getTotalCount();
    }

    @Override
    public int addArticle(ArticleInfo articleInfo) {
        return articleMapper.addArticle(articleInfo);
    }

    @Override
    public ArticleInfo getDetailByAid(Long aid) {
        return articleMapper.getDetailByAid(aid);
    }

    @Override
    public int updateArticle(ArticleInfo articleInfo) {
        return articleMapper.updateArticle(articleInfo);
    }

    @Override
    public int deleteArticle(Long aid, Long uid) {
        return articleMapper.deleteArticle(aid,uid);
    }

    @Override
    public ArticleInfoVO getDetail(Long aid) {
        return articleMapper.getDetail(aid);
    }

    @Override
    public int updateRCount(Long aid) {
        return articleMapper.updateRCount(aid);
    }


}
